/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.flexengine.math;

/**
 * @author Luann R. Athayde
 * @version 1.0
 * @since 1.0
 */
public class Circle extends Form2D {

    private float radius;

    public Circle(float x, float y, float radius) {
        super("Circle", x, y);
        this.radius = radius;
    }
    public Circle() {
        this(0,0,0);
    }

    public float getRadius() {
        return radius;
    }

    public void setRadius(float radius) {
        this.radius = radius;
    }

    public float getDiameter() {
        return radius * 2;
    }
    
    @Override
    public float getArea() {
        return (float)(Math.PI * (radius*radius));
    }
    
    @Override
    public String toString() {
        return getName()+"{" + "x=" + getX() + ", y=" + getY() + ", radius=" + radius + '}';
    }
    
}
